<?php 
header('Content-type:text/html;charset=utf-8');
class Human{
	//属性****
	public $name;
	public $sex;
	public $age;
	public $eyesColor;
	public $hairColor;
	//方法****
	public function __construct(){
		echo '我执行了</br>';
	}
	public function walk(){
		//$this 当前对象
		echo '姓名是：' . $this->name . '<br/>';
		echo '年龄是：' . $this->age . '<br/>';
		echo '性别是：' . $this->sex . '<br/>';
		echo '眼睛是：' . $this->eyesColor . '<br/>';
		echo '头发是：' . $this->hairColor . '<br/>';
		echo '我会行走<br/>';
	}
	
	public function think(){
	    echo '思考';
	}
}
//实例化对象
$obj1 = new Human;
$obj1->name = '张国宝';
$obj1->sex = '男';
$obj1->age = 18;
$obj1->eyesColor = '红色';
$obj1->hairColor = '绿色';
$obj1->walk();

echo '<hr/>';

$obj2 = new Human;
$obj2->name = '任天明';
$obj2->sex = '女';
$obj2->age = 90;
$obj2->eyesColor = '白色';
$obj2->hairColor = '白色';
$obj2->walk();


 ?>